//
//  LunBoTuView.m
//  太平洋电脑网
//
//  Created by dllo on 16/6/25.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "LunBoTuView.h"
#import "JHCustomMenu.h"

@interface LunBoTuView ()<JHCustomMenuDelegate>
@property (nonatomic,retain)JHCustomMenu *menu;
@end

@implementation LunBoTuView
//广场页面 tableView点击来的内容model.topicUrl;
//轮播图的内容 不知道

- (void)viewDidLoad {
    [super viewDidLoad];
    [self createConfig];
}
- (void)createConfig{
    
    self.view.backgroundColor = [UIColor whiteColor];
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(20, 0, 40, 40);
    [button setImage:[UIImage imageNamed:@"其他"] forState:UIControlStateNormal];
    [button addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:button];
    
    UILabel *lable = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 414, 40)];
    self.navigationItem.titleView = lable;
    UIButton *one = [UIButton buttonWithType:UIButtonTypeCustom];
    one.frame = CGRectMake(160, 0, 50, 30);
    [one setImage:[UIImage imageNamed:@"楼主"] forState:UIControlStateNormal];
    [lable addSubview:one];
    UIButton *two = [UIButton buttonWithType:UIButtonTypeCustom];
    two.frame = CGRectMake(230, 0, 30, 30);
    [two setImage:[UIImage imageNamed:@"分享"] forState:UIControlStateNormal];
    [lable addSubview:two];
}
#pragma mark - 三个点页面
- (void)buttonAction:(UIButton *)button{
    __weak __typeof(self) weakSelf = self;
    if (!self.menu) {
        self.menu = [[JHCustomMenu alloc] initWithDataArr:@[@"收藏", @"复制链接", @"正文字号", @"夜间模式", @"打开手势"]  width:150 rowHeight:44];
        _menu.delegate = self;
        _menu.dismiss = ^() {
            weakSelf.menu = nil;
        };
        _menu.arrImgName = @[@"哈哈1.png", @"哈哈2.png", @"哈哈3.png", @"哈哈4.png", @"哈哈5.png"];
        [self.view addSubview:_menu];
    } else {
        [_menu dismissWithCompletion:^(JHCustomMenu *object) {
            weakSelf.menu = nil;
        }];
    }
}
- (void)jhCustomMenu:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
//点击方法
}
#pragma mark - 分享页面
#pragma mark - 楼主按钮

























- (void)viewWillAppear:(BOOL)animated{
    self.navigationController.navigationBar.barTintColor =[UIColor colorWithRed:0.87f green:0.87f blue:0.87f alpha:1.00f];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
